/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.app.response;

import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author haolw
 * @time 2017/10/31
 */
public class CompanyNameResponse {
    private String name;
    private String shortName;
    private String alias;
    private String logo;
    private String userAuthId;
    private String companyId;
    private String codeValue;
    private boolean isShowRedPacket;
    //用来前后端校验广告点击事件 随机字符串
    private String activeCode;

    private Integer adType;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getShortName() {
        return shortName;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getUserAuthId() {
        return userAuthId;
    }

    public void setUserAuthId(String userAuthId) {
        this.userAuthId = userAuthId;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getCodeValue() {
        return codeValue;
    }

    public void setCodeValue(String codeValue) {
        this.codeValue = codeValue;
    }

    public boolean isShowRedPacket() {
        return isShowRedPacket;
    }

    public void setShowRedPacket(boolean showRedPacket) {
        isShowRedPacket = showRedPacket;
    }

    public String getActiveCode() {
        return activeCode;
    }

    public void setActiveCode(String activeCode) {
        this.activeCode = activeCode;
    }

    public boolean verify() {
        return !(StringUtils.isBlank(name) && StringUtils.isBlank(shortName));
    }

    public Integer getAdType() {
        return adType;
    }

    public void setAdType(Integer adType) {
        this.adType = adType;
    }

    public Map<String, String> getModelMap() {
        Map<String, String> modelMap = new HashMap<String, String>();
        String showName = this.getAlias();
        if (StringUtils.isBlank(showName)) {
            showName = this.getName();
        }
        modelMap.put("name", showName);
        modelMap.put("shortName", shortName);
        modelMap.put("logo", logo);
        modelMap.put("userAuthId", userAuthId);
        modelMap.put("companyId", companyId);
        modelMap.put("codeValue", codeValue);
        modelMap.put("isShowRedPacket", isShowRedPacket + "");
        modelMap.put("adType", adType + "");
        return modelMap;
    }
}
